home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 1319 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  3.1 KB

  1. Path: mail2news.demon.co.uk!genesis.demon.co.uk
  2. From: Lawrence Kirby <fred@genesis.demon.co.uk>
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Locaton of an array?
  5. Date: Sat, 13 Jan 96 00:51:51 GMT
  6. Organization: none
  7. Message-ID: <821494311snz@genesis.demon.co.uk>
  8. References: <4d4iqk$hs3@overload.lbl.gov> <4d698s$g4r@news.iag.net> <4d6nd7$4gg@overload.lbl.gov>
  9. Reply-To: fred@genesis.demon.co.uk
  10. X-NNTP-Posting-Host: genesis.demon.co.uk
  11. X-Newsreader: Demon Internet Simple News v1.27
  12. X-Mail2News-Path: genesis.demon.co.uk
  13.  
  14. In article <4d6nd7$4gg@overload.lbl.gov>
  15.            mfaiguen@issserv4.lbl.gov "Mikhail Faiguenblat" writes:
  16.  
  17. >Tanmoy Bhattacharya (tanmoy@qcd.lanl.gov) wrote:
  18. >[stuff deleted]
  19. >:    Btw, just  out of curiosity, why do you care where it lives in  
  20. >:    absolute RAM?
  21. >
  22. >I just posted the description of the problem.
  23. >Also, if anyone has written or knows of a C program that uses DMA, how did
  24. >you deal with the issue of having to specify the physical addresses (I do not
  25. >know if that is the issue for other processors, but for x86 it is).
  26.  
  27. Such issues can only be resolved by intimate knowledge og or help from
  28. your particular system. Since comp.lang.c concerns the C language and is
  29. an essentially system-independent newsgroup it is the wrong place to look.
  30. Try a DOS or Windows proramming newsgroup.
  31.  
  32. >: By the way, the output of %p (as also the result of the (int) cast on
  33. >: a pointer) is upto the implementation. C can be implemented on machines
  34. >: which have no natural mapping onto a flat address space, so the
  35. >: original question may not have a definite meaning. An answer to the
  36. >: `why' that you ask is definitely required before more help can be
  37. >: provided.
  38. >Ok, so C works with virtual addresses,
  39.  
  40. C doesn't care how the addresses are implemented, as long as the rules
  41. of the language are met - basically pointers to different objects of
  42. compatible types must compare unequal and pointer arithmetic must work
  43. within the bounds of an array (or 1 past the end).
  44.  
  45. >and all the registers (such as
  46. >segment register, offset register, etc.) also store virtual addresses.
  47.  
  48. The C language has no concept of these types of register.
  49.  
  50. >Also, a program when being executed writes to and reads from real memory.
  51. >This means that somewhere there is a virtual memory mamnager (?) which 
  52. >keeps track of which segment of virtual memory corresponds to which
  53. >segment of real memory.
  54.  
  55. Yes. For instance on PCs address tranlation is part of the archetecture 
  56. of 386's and above.
  57.  
  58. >Is it done on kernel level?
  59.  
  60. It is often the OS/kernel that controls the address translation hardware
  61. and keep track of the overall virtual memory space.
  62.  
  63. >I do remember that SB drivers on Linux use DMA, and they are linked into the
  64. >kernel and have a special buffer used for DMA transfer.
  65.  
  66. Exactly. How you would achieve this using Linux kernel code is likely
  67. to be very different to how you achieve it using code under Windows. You
  68. need to ask in a newsgroup relevant to the implementation concerned.
  69.  
  70. -- 
  71. -----------------------------------------
  72. Lawrence Kirby | fred@genesis.demon.co.uk
  73. Wilts, England | 70734.126@compuserve.com
  74. -----------------------------------------
  75.